/**
* \file	Value.h
* \author	Caio Arce Nishibe (caionishibe@gmail.com)
* \date	August, 2014
* \brief	Value header.
*/
#ifndef __VALUE_H
#define __VALUE_H

#include "Common.h"

/**
* \brief	Store a value from any kind.
* \author	Caio Arce Nishibe (caionishibe@gmail.com)
* \date	August, 2014
*/
class Value
{
private:
	/**
	 * \brief number value
	 */
	double number;
	/**
	 * \brief string value
	 */
	string str;
	/**
	 * \brief comparation operator value
	 */
	CompOp compOp;
	/**
	 * \brief logic operator value
	 */
	LogicOp logicOp;
	/**
	 * \brief arithmetic operator value
	 */
	ArithOp arithOp;

	/**
	 * \brief Set value from a void pointer by type
	 * \param type value type
	 * \param val pointer to the value
	 */
	void SetValue(Type type, void *val);
public:
	/**
	 * \brief Constructor
	 */
	Value();
	/**
	 * \brief Destructor
	 */
	~Value();

	/**
	 * \brief Set the value from string
	 * \param str string value
	 */
	void SetValueFromString(std::string str);

	/**
	 * \brief Set the value from number
	 * \param number number value
	 */
	void SetValueFromNumber(double number);
	/**
	 * \brief Set the value from comparation operator
	 * \param op comparation operator value
	 */
	void SetValueFromOpComp(CompOp op);
	/**
	 * \brief Set the value from a logic operator
	 * \param op logic operator value
	 */
	void SetValueFromOpLogic(LogicOp op);
	/**
	 * \brief Set the value from an arithmetic operator
	 * \param op arithmetic operator value
	 */
	void SetValueFromOpArit(ArithOp op);
	/**
	 * \brief Get the value from a given type
	 * \param type type of the value
	 * \param val pointer to the value to be returned
	 */
	void GetValue(Type type, void *val);

	/**
	 * \brief Print on console the value by type
	 * \param type value type
	 */
	void PrintValue(Type type);

};

#endif